/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
  const valid_map = ['admin', 'editor']
  return valid_map.indexOf(str.trim()) >= 0
}

export const statusList = [
  {code: '00', name: '立项'},
  {code: '01', name: '立项待审批'},
  {code: '02', name: '立项审批通过'},
  {code: '41', name: '招标待审批'},
  {code: '42', name: '招标审批通过'},
  {code: '60', name: '项目建设开工'},
  {code: '61', name: '开工待审批'},
  {code: '62', name: '开工审批通过/建设'},
  {code: '80', name: '工程验收'},
  {code: '81', name: '验收待审批'},
  {code: '82', name: '验收审批通过'},
  {code: '99', name: '项目归档'}
]

export const scaleList = [
  {code: '0', name: '10万以下'},
  {code: '1', name: '10万到20万'},
  {code: '2', name: '20万到60万'},
  {code: '3', name: '60万以上'},
]
